<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>sock: E:/git/sock/sock/net/socket.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">sock
   &#160;<span id="projectnumber">v0.11</span>
   </div>
   <div id="projectbrief">C++ Network Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_99ede9081e3122cb31ab1bd7b142cd6c.html">sock</a></li><li class="navelem"><a class="el" href="dir_7c33e989e8c050d7b2ba91a16c41033d.html">sock</a></li><li class="navelem"><a class="el" href="dir_d903d5916af6fe48bd2085e947d1c878.html">net</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">socket.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="socket_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Name         : socket.h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Author       : 671643387</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Date         : 2015年10月6日</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Description  :</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef SOCK_NET_SOCKET_H_</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define SOCK_NET_SOCKET_H_</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;boost/noncopyable.hpp&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#if defined(__WINDOWS__)</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;WinSock2.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#elif defined(__LINUX__)</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;arpa/inet.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;netdb.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;sys/socket.h&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacesock.html">sock</a></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;{</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="keyword">namespace </span>net</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#if defined(__WINDOWS__)</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        typedef ::SOCKET    sock_t;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <span class="keyword">typedef</span> <span class="keywordtype">int</span>         socklen_t;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#elif defined(__LINUX__)</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        <span class="keyword">typedef</span> <span class="keywordtype">int</span>         sock_t;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define INVALID_SOCKET      sock_t(-1)</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#define SOCKET_ERROR        -1</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <span class="comment">/* IO阻塞中 */</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        <span class="keyword">const</span> <span class="keyword">static</span> <span class="keywordtype">int</span> SOCKET_ERROR_WOULDBLOCK = -500;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classsock_1_1net_1_1_socket.html">   38</a></span>&#160;        <span class="keyword">class </span><a class="code" href="classsock_1_1net_1_1_socket.html">Socket</a> : <span class="keyword">public</span> boost::noncopyable</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        {</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;            <span class="keyword">explicit</span> <a class="code" href="classsock_1_1net_1_1_socket.html#ae42299933b7d6448b99ab840f04471b8">Socket</a>(sock_t <a class="code" href="namespacesock.html">sock</a>);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            <a class="code" href="classsock_1_1net_1_1_socket.html#ae42299933b7d6448b99ab840f04471b8">Socket</a>(<span class="keywordtype">int</span> family, <span class="keywordtype">int</span> type, <span class="keywordtype">int</span> protocol);</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            <a class="code" href="classsock_1_1net_1_1_socket.html#a763aae809efa471def8e7918281c3a1c">~Socket</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1net_1_1_socket.html#abf71d50699036a8a69cb362a9ac7ad02">close</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classsock_1_1net_1_1_socket.html#a31726f1fff129300731ef86d90b7eec4">   55</a></span>&#160;            sock_t <a class="code" href="classsock_1_1net_1_1_socket.html#a31726f1fff129300731ef86d90b7eec4">getSock</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sock_; }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;            <span class="keywordtype">int</span> <a class="code" href="classsock_1_1net_1_1_socket.html#a25675e062ae83762dd1e25ef745f6ba1">receive</a>(<span class="keywordtype">char</span>* buff, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> flags = 0);</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="keywordtype">int</span> <a class="code" href="classsock_1_1net_1_1_socket.html#af2218f65624a640161009ddd0bfa509e">send</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* buff, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> flags = 0);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#ae714f7ccae9a27faf665ac3570022c3e">getpeername</a>(<span class="keyword">struct</span> sockaddr* addr, socklen_t* addrlen);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#a91f3a52d5e6ede3892cc8cbd8ac34a13">getsockname</a>(<span class="keyword">struct</span> sockaddr* addr, socklen_t* addrlen);</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#ad378344115303d72510ca9df7124629a">setOption</a>(sock_t sock, <span class="keywordtype">int</span> level, <span class="keywordtype">int</span> optname, <span class="keyword">const</span> <span class="keywordtype">void</span>* optval, socklen_t optlen);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#afbaabe6b8436c32418cd14a6253a1f70">getOption</a>(sock_t sock, <span class="keywordtype">int</span> level, <span class="keywordtype">int</span> optname, <span class="keywordtype">void</span>* optval, socklen_t* optlen);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#ac128e602223fe5a9416b3f1a67009282">setNonblocking</a>(sock_t sock, <span class="keywordtype">bool</span> on);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#a2476dc993b75de2de00955468508fc8c">setLinger</a>(sock_t sock, <span class="keywordtype">bool</span> on);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#a94e161e16e429d119a01aaf6c8a5f13a">setReuseAddr</a>(sock_t sock, <span class="keywordtype">bool</span> on);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classsock_1_1net_1_1_socket.html#abf71d50699036a8a69cb362a9ac7ad02">close</a>(sock_t&amp; sock);</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classsock_1_1net_1_1_socket.html#a25675e062ae83762dd1e25ef745f6ba1">receive</a>(sock_t sock, <span class="keywordtype">char</span>* buff, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> flags = 0);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classsock_1_1net_1_1_socket.html#af2218f65624a640161009ddd0bfa509e">send</a>(sock_t sock, <span class="keyword">const</span> <span class="keywordtype">char</span>* buff, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> flags = 0);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#ae714f7ccae9a27faf665ac3570022c3e">getpeername</a>(sock_t sock, <span class="keyword">struct</span> sockaddr* addr, socklen_t* addrlen);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1net_1_1_socket.html#a91f3a52d5e6ede3892cc8cbd8ac34a13">getsockname</a>(sock_t sock, <span class="keyword">struct</span> sockaddr* addr, socklen_t* addrlen);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;            <span class="keywordtype">void</span> reset(sock_t sock);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            sock_t sock_;</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        };</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    }</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;}</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SOCK_NET_SOCKET_H_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_ad378344115303d72510ca9df7124629a"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#ad378344115303d72510ca9df7124629a">sock::net::Socket::setOption</a></div><div class="ttdeci">static bool setOption(sock_t sock, int level, int optname, const void *optval, socklen_t optlen)</div><div class="ttdoc">设置套接字选项 </div><div class="ttdef"><b>Definition:</b> socket.cc:67</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_afbaabe6b8436c32418cd14a6253a1f70"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#afbaabe6b8436c32418cd14a6253a1f70">sock::net::Socket::getOption</a></div><div class="ttdeci">static bool getOption(sock_t sock, int level, int optname, void *optval, socklen_t *optlen)</div><div class="ttdoc">获取套接字选项 </div><div class="ttdef"><b>Definition:</b> socket.cc:77</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_ae714f7ccae9a27faf665ac3570022c3e"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#ae714f7ccae9a27faf665ac3570022c3e">sock::net::Socket::getpeername</a></div><div class="ttdeci">bool getpeername(struct sockaddr *addr, socklen_t *addrlen)</div><div class="ttdoc">获取套接字远程地址 </div><div class="ttdef"><b>Definition:</b> socket.cc:55</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_a763aae809efa471def8e7918281c3a1c"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#a763aae809efa471def8e7918281c3a1c">sock::net::Socket::~Socket</a></div><div class="ttdeci">~Socket(void)</div><div class="ttdef"><b>Definition:</b> socket.cc:29</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_a25675e062ae83762dd1e25ef745f6ba1"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#a25675e062ae83762dd1e25ef745f6ba1">sock::net::Socket::receive</a></div><div class="ttdeci">int receive(char *buff, size_t length, int flags=0)</div><div class="ttdoc">接收数据 </div><div class="ttdef"><b>Definition:</b> socket.cc:39</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_ae42299933b7d6448b99ab840f04471b8"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#ae42299933b7d6448b99ab840f04471b8">sock::net::Socket::Socket</a></div><div class="ttdeci">Socket(sock_t sock)</div><div class="ttdef"><b>Definition:</b> socket.cc:17</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_a94e161e16e429d119a01aaf6c8a5f13a"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#a94e161e16e429d119a01aaf6c8a5f13a">sock::net::Socket::setReuseAddr</a></div><div class="ttdeci">static bool setReuseAddr(sock_t sock, bool on)</div><div class="ttdoc">设置重用地址 </div><div class="ttdef"><b>Definition:</b> socket.cc:107</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_af2218f65624a640161009ddd0bfa509e"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#af2218f65624a640161009ddd0bfa509e">sock::net::Socket::send</a></div><div class="ttdeci">int send(const char *buff, size_t length, int flags=0)</div><div class="ttdoc">发送数据 </div><div class="ttdef"><b>Definition:</b> socket.cc:44</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_ac128e602223fe5a9416b3f1a67009282"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#ac128e602223fe5a9416b3f1a67009282">sock::net::Socket::setNonblocking</a></div><div class="ttdeci">static bool setNonblocking(sock_t sock, bool on)</div><div class="ttdoc">设置IO阻塞状态 </div><div class="ttdef"><b>Definition:</b> socket.cc:86</div></div>
<div class="ttc" id="namespacesock_html"><div class="ttname"><a href="namespacesock.html">sock</a></div><div class="ttdef"><b>Definition:</b> atomic.h:17</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_a31726f1fff129300731ef86d90b7eec4"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#a31726f1fff129300731ef86d90b7eec4">sock::net::Socket::getSock</a></div><div class="ttdeci">sock_t getSock(void) const </div><div class="ttdoc">获取本地套接字 </div><div class="ttdef"><b>Definition:</b> socket.h:55</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_abf71d50699036a8a69cb362a9ac7ad02"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#abf71d50699036a8a69cb362a9ac7ad02">sock::net::Socket::close</a></div><div class="ttdeci">void close(void)</div><div class="ttdef"><b>Definition:</b> socket.cc:34</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html">sock::net::Socket</a></div><div class="ttdoc">套接字 </div><div class="ttdef"><b>Definition:</b> socket.h:38</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_a91f3a52d5e6ede3892cc8cbd8ac34a13"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#a91f3a52d5e6ede3892cc8cbd8ac34a13">sock::net::Socket::getsockname</a></div><div class="ttdeci">bool getsockname(struct sockaddr *addr, socklen_t *addrlen)</div><div class="ttdoc">获取套接字本地地址 </div><div class="ttdef"><b>Definition:</b> socket.cc:60</div></div>
<div class="ttc" id="classsock_1_1net_1_1_socket_html_a2476dc993b75de2de00955468508fc8c"><div class="ttname"><a href="classsock_1_1net_1_1_socket.html#a2476dc993b75de2de00955468508fc8c">sock::net::Socket::setLinger</a></div><div class="ttdeci">static bool setLinger(sock_t sock, bool on)</div><div class="ttdoc">设置linger模式 </div><div class="ttdef"><b>Definition:</b> socket.cc:99</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
